package com.tyqx.hashchainbean.module;

import com.alibaba.fastjson.annotation.JSONField;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

public class NeedProduct implements Serializable {
    private Integer id;

    private String userName;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date needTime;

    private String needName;

    private String needUnit;

    private Integer needNum;

    private BigDecimal needPrice;

    private String needPerson;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    private String hashValue;

    private static final long serialVersionUID = 1L;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName == null ? null : userName.trim();
    }

    public Date getNeedTime() {
        return needTime;
    }

    public void setNeedTime(Date needTime) {
        this.needTime = needTime;
    }

    public String getNeedName() {
        return needName;
    }

    public void setNeedName(String needName) {
        this.needName = needName == null ? null : needName.trim();
    }

    public String getNeedUnit() {
        return needUnit;
    }

    public void setNeedUnit(String needUnit) {
        this.needUnit = needUnit == null ? null : needUnit.trim();
    }

    public Integer getNeedNum() {
        return needNum;
    }

    public void setNeedNum(Integer needNum) {
        this.needNum = needNum;
    }

    public BigDecimal getNeedPrice() {
        return needPrice;
    }

    public void setNeedPrice(BigDecimal needPrice) {
        this.needPrice = needPrice;
    }

    public String getNeedPerson() {
        return needPerson;
    }

    public void setNeedPerson(String needPerson) {
        this.needPerson = needPerson == null ? null : needPerson.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getHashValue() {
        return hashValue;
    }

    public void setHashValue(String hashValue) {
        this.hashValue = hashValue == null ? null : hashValue.trim();
    }


    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        NeedProduct other = (NeedProduct) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))
            && (this.getNeedTime() == null ? other.getNeedTime() == null : this.getNeedTime().equals(other.getNeedTime()))
            && (this.getNeedName() == null ? other.getNeedName() == null : this.getNeedName().equals(other.getNeedName()))
            && (this.getNeedUnit() == null ? other.getNeedUnit() == null : this.getNeedUnit().equals(other.getNeedUnit()))
            && (this.getNeedNum() == null ? other.getNeedNum() == null : this.getNeedNum().equals(other.getNeedNum()))
            && (this.getNeedPrice() == null ? other.getNeedPrice() == null : this.getNeedPrice().equals(other.getNeedPrice()))
            && (this.getNeedPerson() == null ? other.getNeedPerson() == null : this.getNeedPerson().equals(other.getNeedPerson()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getHashValue() == null ? other.getHashValue() == null : this.getHashValue().equals(other.getHashValue()));
    }


    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode());
        result = prime * result + ((getNeedTime() == null) ? 0 : getNeedTime().hashCode());
        result = prime * result + ((getNeedName() == null) ? 0 : getNeedName().hashCode());
        result = prime * result + ((getNeedUnit() == null) ? 0 : getNeedUnit().hashCode());
        result = prime * result + ((getNeedNum() == null) ? 0 : getNeedNum().hashCode());
        result = prime * result + ((getNeedPrice() == null) ? 0 : getNeedPrice().hashCode());
        result = prime * result + ((getNeedPerson() == null) ? 0 : getNeedPerson().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getHashValue() == null) ? 0 : getHashValue().hashCode());
        return result;
    }


    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userName=").append(userName);
        sb.append(", needTime=").append(needTime);
        sb.append(", needName=").append(needName);
        sb.append(", needUnit=").append(needUnit);
        sb.append(", needNum=").append(needNum);
        sb.append(", needPrice=").append(needPrice);
        sb.append(", needPerson=").append(needPerson);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", hashValue=").append(hashValue);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}